import { Toast } from "vant"
import Vue from "vue"
Vue.use(Toast)

// 失败提示
export const failVantToa = ({message = '服务器正在修整', overlay = true}) => {
    Toast.fail({
        message,
        overlay
    })
}

// 加载中提示
export const loadingVantToa = ({
    message = '', 
    forbidClick = true, 
    loadingType, 
    overlay = true,
    duration = 0
}) => {
    Toast.loading({
        message,
        forbidClick,
        loadingType,
        overlay,
        duration
    })
}

// 隐藏提示
export const clearVantToa = (all = true) => {
    Toast.clear(all)
}

// 文字提示
export const textVantToa = ({message = '', duration = 3000}) => {
    Toast({
        message,
        duration,
    })
}

// 失败文字提示
export const failTextVantToa = (message = '服务器正在修整') => {
    Toast(message)
}